package com.itheima.health.dao;

import com.itheima.health.pojo.Member;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

/**
 * @Author: liangWeiQUQ
 * @Description: 查询
 * @DateTime: 2021/3/5 14:56
 **/
public interface MemberDao extends Mapper<Member> {

    @Select("select count(id) from t_member where regTime <= #{endTime}")
    Integer findByMonth(@Param("endTime")String s);

    /**
       * @Author: 传闻中的梁大侠
       * @Date: 12:01 2021/3/9
       * @Parms []
       * @ReturnType: java.lang.Object
       * @Description: 查询会员总数
     */
    @Select("select count(id) from t_member")
    Integer countTotal();
    /**
       * @Author: 传闻中的梁大侠
       * @Date: 12:09 2021/3/9
       * @Parms [todayStr, todayStr1]
       * @ReturnType: java.lang.Object
       * @Description: 查询某个时间范围内的会员数
     */
    @Select("select count(id) from t_member where regTime between #{startTime} and #{endTime}")
    Object countRangRegTime(@Param("startTime") String todayStr,@Param("endTime")  String todayStr1);
}
